# -*- encoding: utf-8 -*-
'''
@File    :   Control.py   
@Contact :   desufnocs@163.com
@des     :   control路由下pydantic模型
 
@Modify Time       @Author      @Version    @Desciption
------------      ----------    --------    -----------
2025/2/17 12:36   AssenImpact      1.0         None
'''

from pydantic import BaseModel, Field


class responseBaseModel(BaseModel):
    '''
    基本响应模型
    code
    msg
    data
    '''
    code: int = 200
    msg: str | None
    data: dict | None


class deviceBaseInfoModel(BaseModel):
    '''
    设备基本信息模型
    hostname
    systemname
    ip
    '''
    hostname: str
    systemname: str
    ip: str


class PresetsCommandDataModel(BaseModel):
    '''
    [/control]接收参数commandData模型
    command
    '''
    command: str = Field(min_length=1, description="命令不能为空")


class CommandDataModel(BaseModel):
    '''
    [/control/command]自定义指令接收参数
    permission
    command
    '''
    content: str = Field(min_length=1, description="命令不能为空")
    permission: bool = False


class ScriptDataModel(CommandDataModel):
    '''
    [/control/script]自定义指令接收参数
    script_type
    script
    permission
    '''
    script_id: str = Field(min_length=1, description="脚本id不能为空")
    script_type: str = Field(min_length=1, description="脚本类型不能为空")
